home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_actor_aiturner.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  69 lines

  1. # ===================================================================
  2. # Jones 3D Cog Script
  3. #
  4. # actor_AITokarev.cog
  5. #
  6. # [MDR]
  7. #
  8. # Actor script for Combat Turner.
  9. #
  10. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15. message        created
  16. message        killed
  17.  
  18. # ************************** TEMPLATES *************************
  19. template    tplGun=mauser                local
  20. template    tplHealthKit=hlthsml        local
  21.  
  22. # ************************** MISC LOCAL VARS *******************
  23. int            weaponNum=21                local
  24.  
  25. thing        t_turner                    local
  26. thing        t_powerup                    local
  27. vector        randVec                        local
  28. vector        dirVec                        local
  29.  
  30. end
  31.  
  32. # ===================================================================
  33. code
  34.  
  35. # -------------------------------------------------------------------
  36. created:
  37.  
  38.     t_turner = GetSenderRef();
  39.  
  40.     AISetMode(t_turner, 0x20);                        # Set MODE_TOUGHSKIN
  41.  
  42.     SetWeaponModel(t_turner, weaponNum);
  43.     SelectWeapon(t_turner, weaponNum);
  44.  
  45.     return;
  46.  
  47. # -------------------------------------------------------------------
  48. killed:
  49.  
  50.     t_turner = GetSenderRef();
  51.  
  52.     ResetWeaponModel(t_turner);                                        # Swap the gun back out
  53.  
  54.     randVec = VectorSet(0, RandBetween(0, 359), 0);
  55.     dirVec = VectorTransformToOrient(t_turner, '-0.17 0.0 0.0');
  56.  
  57.     t_powerup = CreateThing(tplGun, t_turner);                        # create a gun powerup
  58.     dirVec = VectorRotate(dirVec, randVec);
  59.     SetThingVel(t_powerup, dirVec);
  60.  
  61.     t_powerup = CreateThing(tplHealthKit, t_turner);                # create a healthkit powerup
  62.     dirVec = VectorRotate(dirVec, '0 45 0');
  63.     SetThingVel(t_powerup, dirVec);
  64.  
  65.     return;
  66.  
  67.  
  68. end
  69.